package net.zjitc.service.Impl;

import net.zjitc.domain.Admin;
import net.zjitc.dao.Dao;
import net.zjitc.dao.Impl.DaoImpl;
import net.zjitc.domain.Category;
import net.zjitc.domain.CategorySecond;
import net.zjitc.domain.User;
import net.zjitc.service.Service;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

/**
 * Created by guo on 2017/11/11.
 */
public class ServiceImpl implements Service {
    Dao dao=new DaoImpl();
    public Admin fingUsernameAndPassword(String username, String password) {
        return dao.fingUsernameAndPassword(username,password);
    }

    public List<User> findAll() {
        return dao.findAll();
    }

    public int delete(int uid) {
        return dao.delete(uid);
    }

    public List<Category> findAllCategory() {
        return dao.findAllCategory();
    }

    public int addCategory(Category category) {
        return dao.addCategory(category);
    }

    public int deleteCategory(int cid) {
        return dao.deleteCategory(cid);
    }

    public Category findCategoryId(int cid) {
        return dao.findCategoryId(cid);
    }

    public int updateCategory(Category category) {
        return dao.updateCategory(category);
    }

    public List<CategorySecond> findAllCategorySecond() {
        return dao.findAllCategorySecond();
    }


    public int deleteSecondById(int csid) {
        return dao.deleteSecondById(csid);
    }

    public CategorySecond findCategorySecondId(String csid) throws IllegalAccessException, SQLException, InvocationTargetException {
        return dao.findCategorySecondId(csid);
    }

    public int addCategorySecond(CategorySecond categorySecond) {
        return dao.addCategorySecond(categorySecond);
    }


}
